#pragma once
#include "Counter.h"

#define CHECK_AND_RETURN(status) \
    { \
    NTSTATUS statusCheck = status; \
    if(!NT_SUCCESS(statusCheck)) return statusCheck;\
    }

struct ExtraDeviceExtension
{
   struct DeviceExtension* pdx;
};

struct DeviceExtension
{
    PDEVICE_OBJECT nextDeviceObject;
    utils::Counter incompleteIrpsCounter;
    ExtraDeviceExtension* edx;
};

#define KEY_MAKE  0
#define KEY_BREAK 1
#define KEY_E0    2
#define KEY_E1    4
#define KEY_TERMSRV_SET_LED 8
#define KEY_TERMSRV_SHADOW  0x10
#define KEY_TERMSRV_VKPACKET 0x20

struct KeyboardInputData 
{
    //
    // Unit number.  E.g., for \Device\KeyboardPort0 the unit is '0',
    // for \Device\KeyboardPort1 the unit is '1', and so on.
    //
    USHORT UnitId;

    //
    // The "make" scan code (key depression).
    //
    USHORT MakeCode;

    //
    // The flags field indicates a "break" (key release) and other
    // miscellaneous scan code information defined below.
    //
    USHORT Flags;

    USHORT Reserved;

    //
    // Device-specific additional information for the event.
    //
    ULONG ExtraInformation;
} ;
